﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace Xiaov.SmartWeb.Infrastructure.Config
{
    public static class WebAppConfig
    {
        public static string LoggerName
        {
            get { return ConfigurationManager.AppSettings["LoggerName"]; }
        }

        public static string PluginPath
        {
            get { return ConfigurationManager.AppSettings["PluginPath"]; }
        }

        public static string PluginInstallPath
        {
            get { return ConfigurationManager.AppSettings["PluginInstallPath"]; }
        }

        public static object ActiveRecord
        {
            get { return ConfigurationManager.GetSection("activeRecord"); }
        }

        public static string NumberPerPage
        {
            get { return ConfigurationManager.AppSettings["NumberPerPage"]; }
        }

        public static string ConnectionString
        {
            get { return ConfigurationManager.ConnectionStrings["ConnectionString"].ToString(); }
        }

        public static string DbProviderName
        {
            get { return ConfigurationManager.AppSettings["DbProviderName"]; }
        }

        public static string AppVersion
        {
            get 
            {
                return System.IO.File.GetCreationTime(System.Web.HttpContext.Current.Server.MapPath("~")+"/bin/Xiaov.SmartWeb.Application.dll").ToString("yyMMdd.HHMM");
            }
        }

        public static bool ValidateCode
        {
            get { return ConfigurationManager.AppSettings["ValidateCode"] == "True"; }
        }
    }
}
